//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//
//   PACKAGE   : dcf
//   FILE      : Message.java
//   CLASS     : Message
//   DATE      : 2006-04-01
//   
//   DESCRIPTION
//   The Message class represents a generic message being exchanged between components. All actual messages 
//   to be exchagned must be a subclass of this class. Since messages will be send between processes (generally
//   between machines), this class must be a subclass of java.io.Serializable.
//   
//
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//
//   Copyright (c) 2006 by Hal Smith
//
//   Permission is hereby granted, free of charge, to any person obtaining a copy of this source code 
//   (the "Code")to deal with the Code without restriction, including without limitation the rights to use, copy,
//   modify, merge, publish and distribute the Code, and to permit persons to whom the Code is furnished to do 
//   so, subject to the following conditions:
//
//   The above copyright notice and this permission notice shall be included in all copies or substantial 
//   portions of the Software.
//   
//
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//
//   VERSION HISTORY
//
//
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

package dcf;

import java.io.Serializable;

public abstract class Message implements Serializable {
	
	// The endpoint of the message sender.
	//
	private Endpoint senderEndpoint;

		
	// This operation updates the message sender to that provided. If the supplied sender endpoint is not
	// null, the operation will perform the update and return false. If the endpoint is null, the operation 
	// will log an error and return false. There are no exceptions thrown by this operation.
	//
	public void setSenderEndpoint(Endpoint newSenderEndpoint) {
		
		
		if (newSenderEndpoint == null) {
			
			System.out.println("Message.setSenderEndpoint(initSenderEndpoint):");
			System.out.println("   The supplied sender endpoint cannot be null.");
					
		} else {
			
			senderEndpoint = newSenderEndpoint;
			
		}
	
	} // setSenderEndpoint()
	
	
	// This operation returns the endpoint of the message sender. There are no exceptions thrown by this 
	// operation.
	//
	public Endpoint getSenderEndpoint() {
		
		return senderEndpoint;
	
	} // getSenderEndpoint()
	

} // Message
